package com.financial.service.platbalancepay.config;

import com.financial.service.platbalancepay.intercepter.PlatfromIntercepter;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

//@Configuration
public class PlatfromBalanceAdapter extends WebMvcConfigurerAdapter {


    @Bean
    public PlatfromIntercepter platfromIntercepter() {
        return new PlatfromIntercepter();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 多个拦截器组成一个拦截器链

        registry.addInterceptor(platfromIntercepter()).addPathPatterns("/**");

        super.addInterceptors(registry);
    }



}
